package org.ssssssss.script.parsing;

import java.util.ArrayList;

/**
 * 脚本内参数堆栈化
 * @author  zgn
 * @date    2023/4/17 0017
*/
public class VarScope extends ArrayList<VarIndex> {

	private VarScope parent;

	public VarScope(VarScope parent) {
		this.parent = parent;
	}

	public VarScope() {
	}

	/**
	 *	入栈,初始化
	 * @author  zgn
	 * @date    2023/4/17 0017
	*/
	public VarScope push() {
		return new VarScope(this);
	}

	public VarScope getParent() {
		return parent;
	}

	/**
	 *	出栈,清空
	 * @author  zgn
	 * @date    2023/4/17 0017
	 */
	public VarScope pop() {
		return parent;
	}
}
